#
class JiSuanQi():
    # name='zan'
    #
    # def __init__(self,n):
    #     self.name=n
    #     print('我是实例化函数')
    def jia(self,a,b):
        if isinstance(a,(int,float)) and isinstance(b,(int,float)):
            c=a+b
            if isinstance(c,float):
                w=round(c,2)
                return w
            else:
                return c
        elif a==''or a is None:
            return '第一个数值不可为空'
        elif b==''or b is None:
            return '第二个数值不可为空'
        else:
            return '非法输入'

    def jian(self,a,b):
        if isinstance(a,(int,float)) and isinstance(b,(int,float)):
            c=a-b
            if isinstance(c,float):
                c=round(c,2)
                return c
            else:
                return c
        elif a==''or a is None:
            return '第一个数值不可为空'
        elif b==''or b is None:
            return '第二个数值不可为空'
        else:
            return '非法输入'

    def cheng(self,a,b):
        if isinstance(a,(int,float)) and isinstance(b,(int,float)):
           c=a*b
           if isinstance(c,(int,float)):
               c=round(c,2)
               return c
           else:
               return c
        elif a==''or a is None:
            return '第一个数值不可为空'
        elif b==''or b is None:
            return '第二个数值不可为空'
        else:
            return '非法输入'

    def chu(self,a,b):
        if b==0:
            return '不可为零'
        elif isinstance(a,(int,float)) and isinstance(b,(int,float)):
            c=a/b
            if isinstance(c,(int,float)):
                c=round(c,2)
                return c
            else:
                return c
        elif a=='' or a is None:
            return '第一个数值不可为空'

        elif b==''or b is None:
            return '第二个数值不可为空'
        else:
            return '非法输入'




if __name__=='__main__':
    # ji=JiSuanJi('san')
    # print(ji.name)
    ji = JiSuanQi()
    # ji.jia(2,'a')
    # ji.jia(2,None)







































